<?php
/**
 * Created by PhpStorm.
 * User: hhcycj
 * Date: 2018/4/4
 * Time: 21:10
 */
namespace Async;

echo "start \n";

// 定时器：异步每1秒执行
\swoole_timer_tick(1000, function ($timer_id) {
    echo "1s swoole_timer_tick {$timer_id}\n";
});

// 定时器：异步5秒后执行的
\swoole_timer_after(5000, function () {
    echo "\n 5s swoole_timer_after\n\n";
});

echo "end \n";